package com.personal.system.controller.content.web;


import com.personal.common.result.Result;
import com.personal.system.service.content.web.ApiHomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/blog/v1")
@RequiredArgsConstructor
@Api(tags = "门户首页管理")
public class ApiHomeController {

    private final ApiHomeService homeService;


    @RequestMapping(value = "/report",method = RequestMethod.GET)
    @ApiOperation(value = "增加访问量", httpMethod = "GET", response = Result.class, notes = "增加访问量")
    public Result report(){
        return homeService.report();
    }

    @GetMapping("/webSiteInfo")
    @ApiOperation(value = "网站相关信息", httpMethod = "GET", response = Result.class, notes = "网站相关信息")
    public Result getWebSiteInfo(){
        return homeService.getWebSiteInfo();
    }

    @GetMapping("/")
    @ApiOperation(value = "首页共享数据", httpMethod = "GET", response = Result.class, notes = "首页共享数据")
    public Result getHomeData(){
        return homeService.getHomeData();
    }

    @GetMapping("/hot")
    @ApiOperation(value = "获取各大平台热搜", httpMethod = "GET", response = Result.class, notes = "获取各大平台热搜")
    public Result hot(String type){
        return homeService.hot(type);
    }

    @RequestMapping(value = "/category",method = RequestMethod.GET)
    @ApiOperation(value = "分类列表", httpMethod = "GET", response = Result.class, notes = "分类列表")
    public Result selectCategoryList(){
        return homeService.selectCategoryList();
    }
}

